const baseUrl='http://192.168.4.18:3000'
function http({
    url
}){
    return new Promise((resolve,reject)=>{
        wx.request({
            url: baseUrl+url,
            header: {'content-type':'application/json'},
            method: 'GET',
            dataType: 'json',
            responseType: 'text',
            success: (result)=>{
                resolve(result)
            },
            fail: (err)=>{
                reject(err)
            }
        });
    })
}
function getHotHttp(){
    return http({
        url:'/top/playlist/highquality'
    })
}
function getNewHttp(){
    return http({
        url:'/album/newest'
    })
}
function getHostHttp(){
    return http({
        url:'/personalized/djprogram'
    })
}


module.exports={
    getHotHttp,
    getNewHttp,
    getHostHttp
}